package com.xnyzc.lhy.order.controller.capi.user.change;

import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.order.service.user.change.ChangeMobileService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  更换手机号
 * </p>
 *
 * @author wangshuo
 * @since 2019-07-23
 */
@RestController
@RequestMapping("/capi/user/change")
public class ChangeMobileRecordController {

    @Autowired
    private ChangeMobileService changeMobileService;

    /**
     * 更换手机号
     * @param token 用户token
     * @param newMobile 新手机号
     * @param verificationCode 验证码
     * @return
     */
    @ApiOperation(value = "乘客端更换手机号", notes = "乘客端更换手机号")
    @PostMapping(value = "getUserChangeMobile")
    public Rv getUserChangeMobile(
            @RequestParam(value = "token") String token,
            @RequestParam(value = "newMobile") String newMobile,
            @RequestParam(value = "verificationCode") String verificationCode ){
        return Rv.wrap(changeMobileService.getUserChangeMobile(token, newMobile, verificationCode));
    }
}
